<?php
    $abars = array( "oneb-left-bar",
                    "oneb-right-bar",
                    "tm-left-bar",
                    "tm-right-bar",
                    "daily-left-bar",
                    "daily-middle-bar",
                    "daily-right-bar",
                    "daily-top-bar" );

    if( function_exists( "register_sidebar" ) ) {
        foreach( $abars as $sbname ) {
            register_sidebar( array( "name" => $sbname, "id" => $sbname ) );
        }
    }

/*
    if ( function_exists("register_sidebar") ) {
        register_sidebar( array( "name" => "default-sidebar"
        register_sidebar( array( "name" => "left-sidebar", "id" => "left-sidebar"));
        register_sidebar( array( "name" => "top-news-bar", "id" => "top-news-bar",));
        register_sidebar( array( "name" => "left-news-bar", "id" => "left-news-bar",));
        register_sidebar( array( "name" => "middle-news-bar", "id" => "middle-news-bar",));
        register_sidebar( array( "name" => "right-news-bar", "id" => "right-news-bar",));
        register_sidebar( array( "name" => "blog-sidebar", "id" => "blog-sidebar"));
        register_sidebar( array( "name" => "townmtg-menu-bar", "id" => "townmtg-menu-bar"));
        register_sidebar( array( "name" => "polls-sidebar", "id" => "polls-sidebar"));
        register_sidebar( array( "name" => "logged-out-sidebar", "id" => "logged-out-sidebar"));
        register_sidebar( array( "name" => "calendar-sidebar", "id" => "calendar-sidebar"));
        register_sidebar( array( "name" => "header-sidebar", "id" => "header-sidebar"));
    }
*/

    function topara($s) {
        $ret = "";
        $s = str_replace("<p>", "", str_replace("</p>", "", $s));
        foreach(explode("\n", $s) as $line) {
            if(strlen($line) > 0) {
                $ret .= ("<p>".$line."</p>\n");
            }
        }
        return $ret;
    }

    function google_cal()
    {
        return '
    <iframe src="http://www.google.com/calendar/embed?src=mo7odrquus96ccovd6nmsk6scc%40group.calendar.google.com&ctz=America/Los_Angeles" style="border: 0" width="800" height="600" frameborder="0" scrolling="no"></iframe>
    ';
    }

    function google_calendar($content) {
        return str_replace("<<calendar>>", google_cal(), $content);
    }
    add_filter('the_content','google_calendar');

?>
